// MathLibrary.cpp - Implementation of our DLL
#include "MathLibrary.h"

Calculator::Calculator(QObject *parent) : QObject(parent), m_isReady(true)
{
}

Calculator::~Calculator()
{
}

void Calculator::calculate(int a, int b)
{
    if (!m_isReady) {
        emit calculationError("Calculator not ready");
        return;
    }

    if (b == 0) {
        emit calculationError("Division by zero");
        return;
    }

    // Perform calculation
    int result = a / b;

    // Emit signal with the result
    emit calculationComplete(result);
}
